C FILE: py_avl.f
C--------------------------------------------------
C
C
C--------------------------------------------------
      SUBROUTINE TEST(A, N)
      INTEGER N
      REAL*8 A(N)
      DO I=1,N
         IF (I.EQ.1) THEN
            A(I) = 0.0D0
         ELSEIF (I.EQ.2) THEN
            A(I) = 1.0D0
         ELSE 
            A(I) = A(I-1) + A(I-2)
         ENDIF
      ENDDO
      END
C
C
C
      SUBROUTINE PYAVL_INIT(GEOMETRY_FILE, MASS_FILE, RUN_CASES_FILE)
C--------------------------------------------------
C
C
C--------------------------------------------------
      INCLUDE 'AVL.INC'
      CHARACTER*(*) GEOMETRY_FILE, MASS_FILE, RUN_CASES_FILE
      LOGICAL ERROR

C---- Set basic defaults
      CALL DEFINI()
      CALL MASINI()
C---- Read a new input geometry from input file
      CALL INPUT(LUINP, GEOMETRY_FILE, ERROR)
C---- Set up all parameters
      CALL PARSET()
C---- Process geometry to define strip and vortex data
      CALL ENCALC()
C---- Initialize state
      CALL VARINI()
C---- Read mass distributions file
      CALL MASGET(LUMAS, MASS_FILE, ERROR)
C---- Read run case file
      WRITE(*,*)
      WRITE(*,*) 'Trying to read file: ', RUN_CASES_FILE, '  ...'
      CALL RUNGET(LURUN, RUN_CASES_FILE, ERROR)
      IF(ERROR) THEN
        WRITE(*,*) 'Internal run case defaults used'
        CALL RUNINI
      ELSE
C        WRITE(*,*) NRUN
        WRITE(*,1025) (IR, RTITLE(IR), IR=1, NRUN)
 1025   FORMAT(//' Run cases read  ...',
     &        100(/1X,I4,': ',A))
      ENDIF
      END
C
C--------------------------------------------------
C
C
C--------------------------------------------------
      SUBROUTINE PYAVL_RUN(RUN_CASE)
      INCLUDE 'AVL.INC'
      INTEGER RUN_CASE
      WRITE (*,*) 'PYAVL_RUN'
      INFO = 1
      NITER = 20
      CALL EXEC(NITER,INFO,RUN_CASE)
      CALL OUTTOT(6)
      END
C
C--------------------------------------------------
C
C
C--------------------------------------------------
      SUBROUTINE PYAVL_DUMP()
      CALL MASSHO(6)

      END
C END FILE py_avl.f

